package cn.skycity.framework.core.constants;

public interface SecurityConstants {

    /**
     * 认证请求头key
     */
    String AUTHORIZATION_KEY = "Authorization";
    String HEADER_OAUTH_USER = "oauth2_user";//请求头存储用户信息key

    String HEADER_OAUTH_USER_ID = "oauth2_user_id";//请求头存储用户信息key
    String HEADER_OAUTH_USER_NAME = "oauth2_user_name";//请求头存储用户信息key

    /**
     * JWT令牌前缀
     */
    String JWT_PREFIX = "Bearer ";


    /**
     * Basic认证前缀
     */
    String BASIC_PREFIX = "Basic ";

    /**
     * JWT载体key
     */
    String JWT_PAYLOAD_KEY = "payload";

    String GATEWAY_TOKEN="gatewayToken";

    /**
     * JWT ID 唯一标识
     */
    String JWT_JTI = "jti";

    /**
     * JWT ID 唯一标识
     */
    String JWT_EXP = "exp";

    /**
     * 黑名单token前缀
     */
    String TOKEN_BLACKLIST_PREFIX = "auth:token:blacklist:";

    //
    String USER_ID_KEY = "userId";
    String USER_NAME_KEY = "username";

    //jwt失效时间
    String USER_EXP = "exp";

    //jwt所授权的用户
    String JWT_SUB = "sub";

    /**
     * JWT存储权限前缀
     */
    String AUTHORITY_PREFIX = "ROLE_";

    /**
     * JWT存储权限属性
     */
    String JWT_AUTHORITIES_KEY = "authorities";

    String GRANT_TYPE_KEY = "grant_type";

    String REFRESH_TOKEN = "refresh_token";

    String APP_API_PATTERN = "/*/app-api/**";

    String LOGOUT_PATH = "/skycity-auth/oauth/logout";

    /**
     * 新增菜单路径,新增不存在的路由会导致系统无法访问，线上禁止新增菜单的操作
     */
    String SAVE_MENU_PATH = "/skycity-admin/api/v1/menus";

    /**
     * 认证方式
     */
    String AUTHENTICATION_METHOD = "authenticationMethod";

    /**
     * 验证码key前缀
     */
    String VALIDATE_CODE_PREFIX = "VALIDATE_CODE:";

    /**
     * 短信验证码key前缀
     */
    String SMS_CODE_PREFIX = "SMS_CODE:";

}
